package 曾世昌12_2;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class demo {
    public static void main(String[] args) {
        int arr[] = {80, 98, 87, 65, 32};
        System.out.println( "排序前：" + Arrays.toString( arr ) );
        ArrayList<Integer> l = new ArrayList<>();
        for (int i = 0; i < arr.length; i++) {
            l.add( arr[i] );
        }
        Collections.sort( l, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1-o2;
            }
        } );
        System.out.println( "排序后：" +l );
    }
}
